<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:if test="${Role=='student' }">
<%@ include file="header_student.jsp"%>
</c:if>
<c:if test="${Role=='teacher' }">
<%@ include file="header_teacher.jsp"%>
</c:if>
<c:if test="${Role=='admin' }">
<%@ include file="header_admin.jsp"%>
</c:if>


<div class="dashboard-wrapper">
	<div class="left-sidebar">
		<div class="row-fluid">
			<div class="span2"></div>

			<div class="span10">
				<form action="/mycms/room/bookbytime" method="post">
					<div class="span2"></div>
					<div class="span8">
						<div class="btn-group" data-toggle="buttons">
							<c:forEach items="${datelist }" var="date">
								<label class="btn btn-primary">
									<h4>
										<input type="radio" name="date" id="date1" value="${date }" />
										${date }
									</h4>
								</label>
							</c:forEach>
						</div>
					</div>

					<div class="widget">

						<div class="widget-header">
							<div class="span12">
								<div class="span5"></div>
								<div class="span3">

									<select class="form-control input-lg" name="time">
										<c:forEach items="${timelist }" var="time">
											<c:if test="${time.TId == 1}">
												<option value='${time.TId }' selected='selected'>${time.start }
													~ ${time.end }</option>
											</c:if>
											<c:if test="${time.TId != 1}">
												<option value='${time.TId }'>${time.start }~
													${time.end }</option>
											</c:if>

										</c:forEach>
									</select>
								</div>
								<div class="span4">
									<div class="row">
										<div class="span1">
											<!--  	<button type="button" class="btn btn-primary btn-lg" onclick="window.location.href='boardroombytime.jsp'">查询</button>-->
											<input type="submit" class="btn btn-primary btn-lg"
												value="查询" />
										</div>
										<div class="span1">&nbsp;</div>
										<div class="span3">
											<button type="button" class="btn btn-info btn-lg"
												onclick="window.location.href='/mycms/room/book'">
												重置</button>
										</div>
									</div>
								</div>
							</div>
						</div>
				</form>
				<div class="widget-body">
					<form id="room" name="bookbyroom" action="/mycms/room/bookbyroom"
						method="post">
						<input id="roomid" name="roomid" type="hidden" value="">
						<table
							class="table table-condensed table-striped table-bordered table-hover no-margin">
							<thead>
								<tr>
									<th style="width:20%">房间号</th>
									<th style="width:20%" class="hidden-phone">容纳人数</th>
									<th style="width:10%" class="hidden-phone">是否有多媒体</th>
									<th style="width:20%" class="hidden-phone">备注</th>
									<th style="width:20%" class="hidden-phone"></th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${roomlist }" var="room">
									<tr>
										<td>${room.BId }</td>
										<td class="hidden-phone">${room.BSize }</td>
										<td class="hidden-phone"><c:if test="${room.media == 1}">
                            	有
                            </c:if> <c:if test="${room.media == 0}">
                            	有
                            </c:if></td>
										<td class="hidden-phone">${room.remarks }</td>
										<td class="hidden-phone">
											<center>
												<button id="roomsubmit" type="button"
													class="btn btn-success" onclick="submitroom(${room.BId });">查看可预约时间</button>
											</center>
										</td>

									</tr>
								</c:forEach>
							</tbody>
						</table>
					</form>
				</div>
			</div>
		</div>

	</div>



</div>


</div>
</div>
<!--/.fluid-container-->
</div>
<script type="text/javascript">
    function submitroom(roomid){

  	  var roomnum = document.getElementById('roomid');
  	  var room = document.getElementById('room');
  	  roomnum.value=roomid;
  	  room.submit();
    }
    
    </script>
<jsp:include page="footer.jsp"></jsp:include>
